package com.example.springboot.mapper;

import com.example.springboot.entity.jobs;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface JobsCreateMapper {

    @Select("select * from jobs where company_id=#{id}")
    List<jobs> AllJobsById(int id);

    @Insert("INSERT INTO jobs (company_id,job_title, job_description, requirements, location,salary,deadline,posted_at) " +
            "VALUES (#{company_id},#{job_title}, #{job_description}, #{requirements}, #{location},#{salary},#{deadline}, NOW())")
    void addJobs(jobs jobs);
}
